Product Code Database
Example Keywords: arcade and -produce $5
barcode-scavenger
   » » Wiki: Apache Wicket
Tag Wiki 'Apache Wicket'.
Tag

Apache Wicket, commonly referred to as Wicket, is a component-based web application framework for the Java programming language conceptually similar to and . It was originally written by Jonathan Locke in April 2004. Version 1.0 was released in June 2005. It graduated into an Apache top-level project in June 2007.


Rationale
Traditional model-view-controller (MVC) frameworks work in terms of whole and whole pages. In each request cycle, the incoming request is mapped to a method on a controller object, which then generates the outgoing response in its entirety, usually by pulling data out of a model to populate a view written in specialized . This keeps the application's simple and clear, but can make in the controller difficult.

In contrast, Wicket is closely patterned after frameworks such as Swing. Wicket applications are trees of components, which use listener delegates to react to requests against links and forms in the same way that Swing components react to mouse and keystroke events. Wicket is categorized as a component-based framework.


Design
Wicket uses plain for templating (which enforces a clear separation of presentation and and allows templates to be edited with conventional design tools). Each component is bound to a named element in the XHTML and becomes responsible for rendering that element in the final output. The page is simply the top-level containing component and is paired with exactly one XHTML template. Using a special tag, a group of individual components may be abstracted into a single component called a panel, which can then be reused whole in that page, other pages, or even other panels.

Each component is backed by its own model, which represents the state of the component. The framework does not have knowledge of how components interact with their models, which are treated as objects automatically and persisted between requests. More complex models, however, may be made detachable and provide to arrange their own storage and restoration at the beginning and end of each request cycle. Wicket does not mandate any particular object-persistence or ORM layer, so applications often use some combination of Hibernate objects, or as models.

In Wicket, all server side state is automatically managed. You should never directly use an HttpSession object or similar wrapper to store state. Instead, state is associated with components. Each server-side page component holds a nested hierarchy of stateful components, where each component's model is, in the end, a POJO (Plain Old Java Object)

Wicket aims for simplicity. There are no configuration files to learn in Wicket. Wicket is a simple class library with a consistent approach to component structure.


Example
A Hello World Wicket application, with four files:
HelloWorld.html
The XHTML template.

     
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd" xml:lang="en" lang="en">

   Message goes here
     

HelloWorld.java
The page component that will be bound to the template. It, in turn, binds a child component (the Label component named "message").
package org.wikipedia.wicket;

import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label;

public class HelloWorld extends WebPage {

   /**
    * Constructor
    */
   public HelloWorld() {
       add(new Label("message", "Hello World!"));
   }
     
}

HelloWorldApplication.java
The main application class, which routes requests for the homepage to the HelloWorld page component.
package org.wikipedia.wicket;

import org.apache.wicket.protocol.http.WebApplication;

public class HelloWorldApplication extends WebApplication {

   /**
    * Constructor.
    */
   public HelloWorldApplication() {
   }
     

   /**
    * @see org.apache.wicket.Application#getHomePage()
    */
   public Class getHomePage() {
       return HelloWorld.class;
   }
     
}

web.xml
The application Deployment Descriptor, which installs Wicket as the default handler for the servlet and arranges for HelloWorldApplication to be instantiated at startup.
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> Wicket Example HelloWorldApplication org.apache.wicket.protocol.http.WicketFilter applicationClassName org.wikipedia.wicket.HelloWorldApplication HelloWorldApplication /*


Components
Basic components like form, links, repeaters, and so on are built-in.


Releases
+ Apache Wicket Versions !Series !Description !Latest release !Latest release date
Migrated from Javax APIs to Jakarta APIs. Dependencies upgraded to support Spring Framework 6 and therefore moving to Java 17 as the required minimum platform, and compatible with Java 21. CGLib is replaced with ByteBuddy. Announcing Apache Wicket 10: build modern web applications with Java!. wicket.apache.org. Retrieved on 2024-03-11.10.0.02024-03-11
Moving to Java 11 as the required minimum platform, migrated from JUnit 4 to 5, support for Java 12 and 13, rework page and data storage and other improvements. Announcing Apache Wicket 9: get into the modern Java world!. wicket.apache.org. Retrieved on 2020-10-05.9.16.02023-11-23
Moving to Java 8 as the required minimum platform. Support for Lambdas, required Servlet API version moving to 3.1, support for the new types for handling dates and other improvements. Announcing Apache Wicket 8: Write Less, Achieve More. wicket.apache.org. Retrieved on 2018-05-22. Recommended to upgrade to 9.x version.8.14.02022-01-29
Moving to Java 7 as the required minimum platform, cross site request forgery prevention, support for inline images. The release consist of almost 300 features, improvements and fixes. Apache Wicket v7.0 released. wicket.apache.org. Retrieved on 2018-04-16. Only security fixes, recommended to upgrade to 9.x version.7.18.02021-04-02
Moving to Java 6 as the required minimum platform. Out-of-the box jQuery integration, complete control over AJAX requests, improved event registration in browsers, support for large datasets, dependency management for client side JavaScript libraries, experimental support for websockets. Apache Wicket v6.0.0 released. wicket.apache.org. Retrieved on 2020-10-05.6.30.02018-12-05
Improvements of the Wicket features. Apache Wicket - Apache Wicket releases Wicket 1.5. Wicket.apache.org. Retrieved on 2013-08-13. 1.5.162016-08-05
Moving to Java 5 as the required minimum platform. Apache Wicket - Apache Wicket 1.4 takes typesafety to the next level . Wicket.apache.org. Retrieved on 2013-08-13.1.4.232014-02-06
1.3.72009-07-30
1.2.72008-03-23
1.1.1TBD
1.0.3TBD


See also


Notes

External links
Page 1 of 1
1
Page 1 of 1
1

Account

Social:
Pages:  ..   .. 
Items:  .. 

Navigation

General: Atom Feed Atom Feed  .. 
Help:  ..   .. 
Category:  ..   .. 
Media:  ..   .. 
Posts:  ..   ..   .. 

Statistics

Page:  .. 
Summary:  .. 
1 Tags
10/10 Page Rank
5 Page Refs